package com.webside.distinguish.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.webside.base.baseservice.impl.AbstractService;
import com.webside.distinguish.mapper.DistinguishMapper;
import com.webside.distinguish.model.Distinguish;
import com.webside.distinguish.service.DistinguishService;
@Service("distinguishService")
public class DistinguishServiceImpl extends AbstractService<Distinguish, Long> implements DistinguishService {

	@Autowired
	DistinguishMapper distinguishMapper;
	// 这句必须要加上。不然会报空指针异常，因为在实际调用的时候不是BaseMapper调用，而是具体的mapper，这里为userMapper
	@Autowired
	public void setBaseMapper() {
		super.setBaseMapper(distinguishMapper);
	}
	
	@Override
	public Integer isNameExist(String name) {
		// TODO Auto-generated method stub
		return distinguishMapper.findCountByName(name);
	}
	
}
